package com.example.practical_training_projects.controller;

import com.example.practical_training_projects.entity.appointment;
import com.example.practical_training_projects.service.appointmentService;
import com.example.practical_training_projects.vo.userappointment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("appointment")
public class appointmentController {
    @Autowired
    private appointmentService service;
    @PostMapping("insertappointment")
    public Integer insertYuyue(@RequestBody appointment appointment1) {
        return service.insertYuyue(appointment1);
    }

    @GetMapping("pcselectappointment")
    public List<userappointment> pcselect(Integer pc_uid){
        return  service.pcselect(pc_uid);
    }

    @GetMapping("userselectappointment")
    public List<userappointment> userselectyuyue(Integer user_uid){
        return  service.userselectyuyue(user_uid);
    }

    @GetMapping("admincheckyuyue")
    public List<appointment> admincheck() {
        return service.admincheck();
    }
    @GetMapping("deleteyuyue")
    public Integer deleteAppointment(Integer id){
        return service.deleteAppointment(id);
    }

}
